##########################################################################
#	> File Name: makefile
#	> function: 编译pc端工程的Makefile
#	> Author:	卢孙远(Simon)
#	> company: GDOU
#	> Mail: lsy476941913@live.com 
#	> Created Time: 2017年04月28日 星期二 12时33分36秒
##########################################################################
DIR_INC = ./include
DIR_BIN = ./bin
DIR_LIB = ./libs/x64

TARGET	= index.bin
BIN_TARGET = $(TARGET)

CROSS_COMPILE = 
CFLAGS = -g -Wall -I$(DIR_INC) 

LDFLAGS := -L$(DIR_LIB)/

LDFLAGS += -lmsc -lrt -ldl -lpthread -lasound -Wl,-rpath=./libs
OBJECTS := $(patsubst src/%.c,src/%.o,$(wildcard src/*.c))
$(BIN_TARGET) : $(OBJECTS)
	$(CROSS_COMPILE)gcc $(CFLAGS) $^ -o $(DIR_BIN)/$@ $(LDFLAGS)
	export LD_LIBRARY_PATH=$(pwd)/libs/x64/

%.o : %.c
	$(CROSS_COMPILE)gcc -c $(CFLAGS) $< -o $@
clean:
	make -C src/
	

